package org.jeecg.modules.demo.annualkeywork.service.impl;

import org.jeecg.modules.demo.annualkeywork.entity.KeyWorkDepartments;
import org.jeecg.modules.demo.annualkeywork.entity.ReportAnnualKeyWork;
import org.jeecg.modules.demo.annualkeywork.mapper.KeyWorkDepartmentsMapper;
import org.jeecg.modules.demo.annualkeywork.service.IKeyWorkDepartmentsService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 重点工作配合部门
 * @Author: jeecg-boot
 * @Date:   2025-08-19
 * @Version: V1.0
 */
@Service
public class KeyWorkDepartmentsServiceImpl extends ServiceImpl<KeyWorkDepartmentsMapper, KeyWorkDepartments> implements IKeyWorkDepartmentsService {
	
	@Autowired
	private KeyWorkDepartmentsMapper keyWorkDepartmentsMapper;
//	通过主表id查询子表数据
	@Override
	public List<KeyWorkDepartments> selectByMainId(String mainId) {
		return keyWorkDepartmentsMapper.selectByMainId(mainId);
	}
	//	获取子表的所有数据
	@Override
	public List<KeyWorkDepartments> getAllList() {
		return keyWorkDepartmentsMapper.getAllList();
	}
	//	根据主表id获取子表中的完成进度数据
	@Override
	public List<String> SelectCompletionProgress(String id) {
		return keyWorkDepartmentsMapper.SelectCompletionProgress(id);
	}
	//	保存汇报年度重点工作
    @Override
    public int saveReport(ReportAnnualKeyWork reportAnnualKeyWork) {
        return keyWorkDepartmentsMapper.saveReport(reportAnnualKeyWork);
    }
	//	查找已汇报的重点工作数据
	@Override
	public List<KeyWorkDepartments> SelectFinishedReportAnnualKeyWork() {
		return keyWorkDepartmentsMapper.SelectFinishedReportAnnualKeyWork();
	}
	//	根据子表的id更新任务状态为待审批
	@Override
	public int updateTaskstatusByKid(String id) {
		return keyWorkDepartmentsMapper.updateTaskstatusByKid(id);
	}

}
